﻿using BMS.Entity.RBAC;
using BMS.IRepository;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BMS.Repository
{
    public class PermissionRepository : BaseRepository<PermissionInfo>, IPermissionRepository
    {
        private readonly DbContext db;
        public PermissionRepository(DbContext db) : base(db)
        {
            this.db = db;
        }
        /// <summary>
        /// 获取上级ID
        /// </summary>
        /// <param name="pid">Pid</param>
        /// <returns></returns>
        public async Task<List<PermissionInfo>> GetParentId(int pid)
        {
            var list = db.Set<PermissionInfo>().AsNoTracking().Where(m => m.Id == pid).ToList();
            return list;
        }
    }
}
